import api from './index'

export const userApi = {

  getUsers() {
    return api.get('/api/users')
  },
  

  getUserById(userId) {
    return api.get(`/api/users/${userId}`)
  },
  

  addUser(userData) {
    return api.post('/api/users', userData)
  },
  

  updateUser(userId, userData) {
    return api.put(`/api/users/${userId}`, userData)
  },
  

  deleteUser(userId) {
    return api.delete(`/api/users/${userId}`)
  },
  

  getCustomers() {
    return api.get('/api/users/customers')
  },
  

  getStaff() {
    return api.get('/api/users/staff')
  },


  getCurrentUser() {
    return api.get('/api/users/me')
  },


  updateUser(id, data) {
    return api.put(`/api/users/${id}`, data)
  },


  changeUserPassword(id, password) {
    return api.put(`/api/users/${id}/password`, { password })
  }
} 